#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#define PAINT_EVENT

#include <QMainWindow>
#include <QListWidgetItem>

#include <QNetworkDatagram>
#include <QImage>
#include <QMap>
#include <QUdpSocket>


QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
        Q_OBJECT

    public:
        MainWindow(QWidget *parent = nullptr);
        ~MainWindow();

        void insertDevicesList( const QString & ) ;
        void showVideoframe( const QNetworkDatagram & ) ;

    public slots :
        void readPendingDatagram() ;
        void on_updateList_clicked() ;
        void on_devicesList_itemClicked(QListWidgetItem *item) ;
        void on_start_clicked() ;
        void on_stop_clicked() ;

    protected :
#ifdef PAINT_EVENT
        void paintEvent(QPaintEvent *ev) override ;
#endif

    private slots:
        void on_setPort_clicked();

    private:
        Ui::MainWindow *ui;

        QString ipFliter ;
        QImage img ;
        QUdpSocket *uc ;
        bool sf ;

};
#endif // MAINWINDOW_H
